package com.exm.collectcodenew.kafka.producer.customSerializer2;

import org.apache.kafka.common.serialization.Deserializer;

import java.io.IOException;
import java.util.Map;

public class DecodingKafka implements Deserializer<Object> {
    @Override
    public void configure(Map<String, ?> configs, boolean isKey) {
    }

    @Override
    public Object deserialize(String topic, byte[] data) {
        try {
            return BeanUtils.byteToObj(data);
        } catch (IOException e) {
            throw new RuntimeException(e);
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public void close() {
    }
}
